package com.lss.cloud.service.Impl;

import com.lss.cloud.entities.Pay;
import com.lss.cloud.mapper.PayMapper;
import com.lss.cloud.service.PayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 2024/3/13-19:32
 * 功能:
 */
@Service
@Slf4j

public class PayServiceImpl implements PayService {
    @Autowired
    private PayMapper payMapper;
    @Override
    public int add(Pay pay){
        return payMapper.insertSelective(pay);
    }
    @Override
    public int delete(Integer id){
        return payMapper.deleteByPrimaryKey(id);
    }
    @Override
    public int update(Pay pay){
        return payMapper.updateByPrimaryKeySelective(pay);
    }
    @Override
    public Pay getById(Integer id){
        return payMapper.selectByPrimaryKey(id);
    }
    @Transactional
    @Override
    public List<Pay> getAll(){
        return payMapper.selectAll();
    }
}
